//
//  UIScrollView+MLRefreshControl.h
//  TycoonSale
//
//  Created by molon on 15/8/18.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MLRefreshControlConstants.h"

@class MLRefreshControlView,MLRefreshControlAnimateView;
@interface UIScrollView (MLRefreshControl)

/**
 *  提示View
 */
@property (nonatomic,strong,readonly) MLRefreshControlView *refreshView;
/**
 *  最后刷新时间
 */
@property (nonatomic,strong) NSDate *lastRefreshTime;
/**
 *  是否处于刷新状态
 */
@property (nonatomic,assign,readonly) BOOL isRefreshing;

/**
 *  是否在结束刷新的时候滚动到头部
 */
@property (nonatomic, assign,readonly) BOOL scrollToTopAfterEndRefreshing;




/**
 *  对此scrollView启用下拉刷新,提供刷新方法和在结束刷新之后是否自动滚动到头部
 */
- (void)enableRefreshingWithAction:(MLRefreshControlActionBlock)actionBlock scrollToTopAfterEndRefreshing:(BOOL)scrollToTopAfterEndRefreshing;
- (void)enableRefreshingWithAction:(MLRefreshControlActionBlock)actionBlock scrollToTopAfterEndRefreshing:(BOOL)scrollToTopAfterEndRefreshing animteView:(MLRefreshControlAnimateView*)animateView;
/**
 *  停止刷新，需要在数据加载完毕之后明确调用
 */
- (void)endRefreshing;

/**
 *  主动调用开始刷新操作
 */
- (void)beginRefreshing;

@end
